package com.gl.file;

public class TestObj {
	public static void main(String[] args) throws Exception{ 
		Teacher t = new Teacher("tangliang",30);
		Student s1 = new Student("zhangsan",18,t);
		Student s2 = (Student)s1.deepClone();
		s2.t.setName("tony");
		s2.t.setAge(40);
		System.out.println("name=" + s1.t.getName() + ","+"age=" + s1.t.getAge());//学生1的老师不改变
		System.out.println("s2---name=" + s2.t.getName() + ","+"age=" + s2.t.getAge());//学生1的老师不改变
		}
}
